﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Comom.Project.ControllerCom;
using Dhtl.Service.IService;
using dai_hoc_tuong_lai.Areas.Admin.Models;

namespace dai_hoc_tuong_lai.Controllers
{
    public class InfoController : UTController
    {
        //
        // GET: /Info/
        private readonly IThongbao _iNews;
        private readonly int PageSize = 15;

        public InfoController(IThongbao iNews)
        {
            this._iNews = iNews;
        }

        public ActionResult List()
        {

            var listEntity = _iNews.List();
            List<ThongbaoModel> model = new List<ThongbaoModel>();
            try
            {
                foreach (var item in listEntity)
                {
                    ThongbaoModel ml = new ThongbaoModel();
                    ThongbaoModel.MapFrom(item, ref  ml);
                    model.Add(ml);
                }
            }
            catch { }

            return PartialView("_List", model);
        }

        public ActionResult Index()
        {
            return View();
        }

    }
}
